<div class="layui-row layui-col-space10 ">
    <div class="layui-col-lg3 layui-col-md6 height-140">
        <div class="block">
            <a style="font-size: 14px;" href="#!player">总用户数:</a><br>
            <span style="font-size: 30px;" id="totalNumber">123,456</span><br>
            游客:<span id="guest">123,456</span><br>
            非游客:<span id="notGuest">123,456</span>
        </div>
    </div>
    <div class="layui-col-lg3 layui-col-md6 height-140">
        <div class="block">
            <a style="font-size: 14px;" href="#!loginChart">今日登录人次:</a><br>
            <span style="font-size: 30px;" id="loginCountToday">123,456</span><br>
        </div>
    </div>
    <div class="layui-col-lg3 layui-col-md6 height-140">
        <div class="block">
            <a style="font-size: 14px;" href="#!registerChart">今日注册用户:</a><br>
            <span style="font-size: 30px;" id="registerCountToday">123,456</span><br>
        </div>
    </div>
    <div class="layui-col-lg3 layui-col-md6 height-140">
        <div class="block">
            <a style="font-size: 14px;" href="#!onlineChart">在线人数:</a><br>
            <span style="font-size: 30px;" id="onlineCountToday">123,456</span><br>
        </div>
    </div>
    <div class="layui-col-lg3 layui-col-md6 height-140">
        <div class="block">
            <a style="font-size: 14px;" href="#!recharge">总充值金额:</a><br>
            <span style="font-size: 30px;" id="totalRechargeMoney">123,456</span><br>
            <!-- <hr> -->
            今日充值人次:<span id="todayRechargeNum">123,456</span><br>
            今日充值金额:<span id="todayRechargeMoney">123,456</span>
        </div>
    </div>
    <div class="layui-col-lg3 layui-col-md6 height-140">
        <div class="block">
            <a style="font-size: 14px;" href="#!consumption">总消费金额:</a><br>
            <span style="font-size: 30px;" id="totalConsumptionMoney">123,456</span><br>
            今日消费人次:<span id="todayConsumptionNum">123,456</span><br>
            今日消费金额:<span id="todayConsumptionMoney">123,456</span>
        </div>
    </div>
</div>
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
<script>
    layui.use(['carousel', 'element', 'admin'], function () {
        var carousel = layui.carousel;
        var element = layui.element;
        var device = layui.device;
        var admin = layui.admin;

        admin.req('api-select/totalData/', {}, function (data) {
            document.getElementById("totalNumber").innerText = toMoney(data.totalNumber);
            document.getElementById("guest").innerText = toMoney(data.guest);
            document.getElementById("notGuest").innerText = toMoney(data.notGuest);
            document.getElementById("loginCountToday").innerText = toMoney(data.loginCountToday);
            document.getElementById("registerCountToday").innerText = toMoney(data.registerCountToday);
            document.getElementById("onlineCountToday").innerText = toMoney(data.onlineCountToday);
            document.getElementById("totalRechargeMoney").innerText = toMoney(data.totalRechargeMoney);
            document.getElementById("todayRechargeNum").innerText = toMoney(data.todayRechargeNum);
            document.getElementById("todayRechargeMoney").innerText = toMoney(data.todayRechargeMoney);
        }, 'GET');

    // 将数字转换成带逗号输出
        function toMoney(num) {
            if (!num){
                return 0;
            }
            num = num.toFixed(0);
            num = parseFloat(num);
            num = num.toLocaleString();
            return num;
        }
    });
</script>